<?php
$tables = db_factory::query("SHOW TABLES LIKE '".TABLEPRE."witkey_msg_tpl'");
if($tables[0]){
	$msgLists = db_factory::query("SELECT * FROM `".TABLEPRE."witkey_msg_tpl`");
	if($msgLists){
		foreach ($msgLists as $k=>$v){
			$sql  = "UPDATE `".TABLEPRE."witkey_msg_config` SET `send_type`='{$v['send_type']}' ,`content`='{$v['content']}'  WHERE k='{$v['tpl_code']}'";
			db_factory::execute($sql);
		}
	}
}

db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('157', 'task_end_manually', 'task', '任务结束通知', '管理员后台手动结束任务时用户会收到此通知。', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161', '<p>您发布的{模型名称}任务{任务标题}被管理员手动结束，原因：{理由}<p>', '1')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('158', 'alipayjs_auth', 'auth', '支付宝认证通知', '后台打款给用户的时候', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161', '<p>您申请的支付宝认证已经受理，管理员已经打款到您的账户，请及时查收，并在<a href=\"index.php?do=user&view=account&op=index&code=alipayjs\">确认收款金额</a>中填写您收到的金额数，以便你认证成功！</p>', '1')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('159', 'alipayjs_auth', 'auth', '支付宝认证通知', '后台打款给用户的时候', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161', '<p>您申请的支付宝认证已经受理，管理员已经打款到您的账户，请及时查收，并在<a href=\"index.php?do=user&view=account&op=index&code=alipayjs\">确认收款金额</a>中填写您收到的金额数，以便你认证成功！</p>', '1')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('160', 'select', 'task', '红包任务', '当用户完成任务时会受到此通知', 'a:2:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;}', '1364996161', '<p>您的红包任务{红包任务}已完成，你得到金额{红包金额}元</p>', '1')");
db_factory::execute(" DROP TABLE IF EXISTS `".TABLEPRE."witkey_msg_tpl`;");